"""
Author: wenbin
Create: 2024-08-17
"""
import uuid

from sqlalchemy import Column, UUID, String, Text, Index

from .base_model import BaseModel


class App(BaseModel):
    """应用模型"""

    __tablename__ = 'app'
    __table_args__ = (
        Index("idx_app_account_id", "account_id"),
        {"comment": "应用表"}
    )

    id = Column(UUID, default=uuid.uuid4, primary_key=True, comment="id")
    account_id = Column(UUID, nullable=False, comment="账号 id")
    name = Column(String(50), nullable=False, comment="应用名称")
    icon = Column(String(255), nullable=False, comment="图标")
    description = Column(Text, nullable=False, comment="描述")
